#include "UdpServer.hpp"
#include <memory>

void Usage(std::string proc)
{
    std::cerr << "Usage :" << proc << "serverip serverport" << std::endl;
}

// ./udp_server serverip serverport
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        Usage(argv[0]);
        exit(0);
    }
    std::string ip = argv[1];
    uint16_t port = std::stoi(argv[2]);
    EnableConsoleLogStrategy();
    std::unique_ptr<UdpServer> ptr = std::make_unique<UdpServer>(ip, port);
    ptr->Init();
    ptr->Start();

    return 0;
}